<script type="text/javascript">
<!--
function imageupload()
{
document.getElementById('review_image').disabled = false;
document.getElementById('review_image').focus();
}
//-->
</script>

<center>
<?if(isset($message) && !is_array($message) ) echo($message);?>
		<?  if(is_array($message) ) {
			foreach ($message as $mess){
				echo $mess['error'];
			}
		}?>
		<? 
if(isset($message1) && !is_array($message1) ) echo($message1);?>
</center>

<table cellpadding="0px" cellspacing="0px">
    <td>
    <?
$attributes = array('class' => 'insert', 'id' => 'reviews_insert','name' => 'reviews_insert');

echo form_open_multipart($action, $attributes);
?>
    <table width="90%">
	<tr>
		<td colspan="2" style="font-size: 16px;color: black;font-weight: bold;text-align: center;">
		 <?if ($button_value=='Add'){ ?> Add Movie Reviews<?} else {?>Edit Movie Reviews<?} ?>
		</td>
	</tr>
	<tr>
		<td width="150"   style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Movie Name :
		</td>
		<td style="text-align: left;">
		<? $id =0; 
		if(isset($review_details->movie_id)) :  $id = $review_details->movie_id; endif;  ?>
			<?=form_dropdown('movie_id',$options,$id); ?>
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">&nbsp;</span> Cast :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Cast" value="<? if(isset($review_details->cast)) :  echo $review_details->cast; endif;  ?>" id="Cast" size="60" />
			<?if(isset($reviewid)) { 
				?>
			<input type="hidden" name="HidId" value="<?=$reviewid ?>" id="HidId" />	
		<?		
			} ?> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">&nbsp;</span> Punchline :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Punchline" value="<? if(isset($review_details->punchline)) :  echo $review_details->punchline; endif;  ?>" id="Punchline" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">&nbsp;</span> Genre :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Genre" value="<? if(isset($review_details->genre)) :  echo $review_details->genre; endif;  ?>" id="Genre" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">&nbsp;</span> Type :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Type" value="<? if(isset($review_details->type)) :  echo $review_details->type; endif;  ?>" id="Type" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">&nbsp;</span> Banner :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Banner" value="<? if(isset($review_details->banner)) :  echo $review_details->banner; endif;  ?>" id="Banner" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Music :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Music" value="<? if(isset($review_details->music)) :  echo $review_details->music; endif;  ?>" id="Music" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Cinematography :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Cinematography" value="<? if(isset($review_details->cinematography)) :  echo $review_details->cinematography; endif;  ?>" id="cinematography" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Art :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Art" value="<? if(isset($review_details->art)) :  echo $review_details->art; endif;  ?>" id="Art" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Stunts :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Stunts" value="<? if(isset($review_details->stunts)) :  echo $review_details->stunts; endif;  ?>" id="Stunts" /> 
		</td>
	</tr>
	<tr>
		<td style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Editing :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Editing" value="<? if(isset($review_details->editing)) :  echo $review_details->editing; endif;  ?>" id="Editing" /> 
		</td>
	</tr>
	<tr>
		<td style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Story :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Story" value="<? if(isset($review_details->story)) :  echo $review_details->story; endif;  ?>" id="Story" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Screenplay :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Screenplay" value="<? if(isset($review_details->screenplay)) :  echo $review_details->screenplay; endif;  ?>" id="Screenplay" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Direction :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Direction" value="<? if(isset($review_details->direction)) :  echo $review_details->direction; endif;  ?>" id="Direction" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Producer :
		</td>
		<td style="text-align: left;">
			<input type="text" name="Producer" value="<? if(isset($review_details->producer)) :  echo $review_details->producer; endif;  ?>" id="Producer" /> 
		</td>
	</tr>
	<tr>
		<td  style="text-align: left;vertical-align: text-top;">
			<span class="star">*</span> Summary :
		</td>
		<td style="text-align: left;">
			<textarea rows="3" cols="50" name="summary" id="summary">
			<? if(isset($review_details->summary)) :  echo $review_details->summary; endif;  ?>
			</textarea> 
		</td>
	</tr>
	<tr>
		<td style="text-align: left; vertical-align: text-top;">
			<span class="star">*</span> Description :
		</td>
		<td style="text-align: left;">
			<textarea rows="3" cols="60" id="description" name="description">
			<? if(isset($review_details->description)) :  echo $review_details->description; endif;  ?>
			</textarea> 
		</td>
	</tr>
	
	<tr>
		<td  style="text-align: left;">
			&nbsp;&nbsp;&nbsp;Image :
		</td>
		<td  style="text-align: left;">
		
			<input type="file" <?if($button_value=="Update") echo "disabled"; ?> name="review_image" id="review_image"/>
			
		</td>
	</tr>
	<tr>
		<td  style="text-align: left; vertical-align: text-top;">
			<span class="star">*</span> Rating :
		</td>
		<td style="text-align: left;">
		<?$ids = 2; 
		if(isset($review_details->rating)) :  $ids = $review_details->rating; endif;  ?>
		<? $rating= array('1' => 1, '1.5' => 1.5 , '2' => 2,'2.5' => 2.5,'3'=>3,'3.5'=>3.5,'4'=>4,'4.5'=>4.5,'5'=>5) ?>
			<?=form_dropdown('rating',$rating,$ids); ?>
		</td>
	</tr>
	<tr>
		<td>
			
		</td>
		<td style="text-align: left;">
		 	<input type="submit" value="<?=$button_value ?>" name="submit"/>
		</td>
	</tr>
	
</table>
<?=form_close()?>
    </td>
    <?if(isset($reviewid)){ ?>
    <td valign="top" style="padding-top: 20px;"><img src="<?=base_url()."assets/images/reviews_".$reviewid."_thumb.jpg" ?>" /> 
    <br/> <a href="javascript:void(0);" onclick="imageupload()">Change Image</a> </td><?} ?>
  </tr>
</table>

